<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<script type="text/javascript">

    $(function () {
        $("#all").on('click', function () {
            var isChecked = $(this).prop("checked");
            $("input[name='id']").prop("checked", isChecked);
        })
        //录费
        $("#addBtn").on('click',function(){
            loadRight();
        })
    })
    function page(n, s) {
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchForm").submit();
        return false;
    }
    function loadRight() {
        var patientId=$("#patientId").val();
        var visitId=$("#visitId").val();
        hideShowTableTd('contentTable', '5,6,7,8,9,10', '2');
        $("#LeftDiv").attr("class", "main-content col-lg-8");
        $("#RightDiv").show('normal');
        return loadDiv('rigthCenterDiv', '${ctx}/orders/orders/feeform?patientId=' + patientId + "&visitId=" + visitId);
    }

</script>
<div class="app">
    <section class="layout">
        <section class="main-content col-lg-12" id="LeftDiv">
            <div class="content-wrap">
                <div class="wrapper" style="bottom: 50px;">
                    <ul class="nav nav-tabs">
                        <li><a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/nurse/index')">床位列表</a></li>

                        <li class="active"><a href="#">费用补录</a></li>

                        <li>
                            <a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/nurse/searchBill?patientId=${patVisit.patientId}&visitId=${patVisit.id}')">查询费用信息</a>
                        </li>
                    </ul>
                    <section class="panel panel-default">
                        <div class="panel-body">
                            <div class="table-responsive no-border">

                                <form:form data-parsley-validate="" modelAttribute="patVisit">
                                    <div class="form-group">
                                        <label class="col-sm-1 control-label">床位号：</label>

                                        <div class="col-sm-2">
                                            <form:input path="bedRec.bedNo" htmlEscape="false" class="form-control" maxlength="200"
                                                        disabled="true"/>
                                        </div>
                                        <label class="col-sm-1 control-label">姓名：</label>

                                        <div class="col-sm-2">
                                            <form:input path="patVisitIndex.name" htmlEscape="false" class="form-control"
                                                        maxlength="200" disabled="true"/>
                                        </div>
                                        <label class="col-sm-1 control-label">性别：</label>

                                        <div class="col-sm-2">
                                            <form:input path="patVisitIndex.sex" htmlEscape="false" class="form-control" maxlength="200"
                                                        disabled="true"/>
                                        </div>

                                    </div>
                                    <div class="form-group">

                                        <label class="col-sm-1 control-label">预交金：</label>

                                        <div class="col-sm-2">
                                            <form:input path="prepayments" htmlEscape="false" class="form-control" maxlength="200"
                                                        disabled="true"/>
                                        </div>
                                        <label class="col-sm-1 control-label">费别：</label>

                                        <div class="col-sm-2">
                                            <form:input path="patVisitIndex.chargeType" htmlEscape="false" class="form-control"
                                                        maxlength="200" disabled="true"/>
                                        </div>
                                        <label class="col-sm-1 control-label">年龄：</label>

                                        <div class="col-sm-2">
                                            <form:input path="patVisitIndex.age" htmlEscape="false" class="form-control" maxlength="200"
                                                        disabled="true"/>
                                        </div>
                                    </div>
                                </form:form>
                                <div class="datatable-top">
                                    <div class="pull-left">
                                        <form:form id="searchForm" modelAttribute="inpBillDetail"
                                                   onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/orders/orders/feeOper');"
                                                   method="post" class="form-inline">
                                            <form:hidden path="patientId"/>
                                            <form:hidden path="visitId"/>
                                            <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                            <input id="pageSize" name="pageSize" type="hidden"
                                                   value="${page.pageSize}"/>
                                            <%--<input name="startTime" value="${orders.startTime}"--%>
                                            <%--class="form-control Wdate" type="text"--%>
                                            <%--onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"--%>
                                            <%--/>--%>
                                            <%--<label>至</label>--%>
                                            <%--<input name="endTime" value="${orders.endTime}" class="form-control Wdate"--%>
                                            <%--type="text"--%>
                                            <%--onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>--%>


                                            <%--<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>--%>
                                            <input id="addBtn" class="btn btn-primary" type="button" style="background-color:blue;"
                                                   value="录费"/>
                                        </form:form>
                                    </div>
                                </div>

                                <table id="contentTable" class="table table-bordered mg-t datatable">
                                    <thead>
                                    <tr>
                                        <th><input type=checkbox id="all"></th>
                                        <th>项目名称</th>
                                        <th>项目类别</th>
                                        <th>项目规格</th>
                                        <th>单位</th>
                                        <th>数量</th>
                                        <th>单价</th>
                                        <th>计价金额</th>
                                        <th>应收金额</th>
                                        <th>开单科室</th>
                                        <th>开单医生</th>
                                        <th>执行科室</th>
                                        <th>执行人</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${page.list}" var="inpBillDetail" varStatus="ss">
                                        <tr id="${inpBillDetail.id}">
                                            <td>
                                                <input type=checkbox name="id"
                                                       value="${inpBillDetail.id}"></td>
                                            <td> ${inpBillDetail.itemName}</td>
                                            <td> ${fns:getDictLabel(inpBillDetail.itemClass,'BILL_ITEM_CLASS_DICT' , '')}</td>
                                            <td> ${inpBillDetail.itemSpec}</td>
                                            <td> ${fns:getDictLabel(inpBillDetail.units, 'SPEC_UNIT', '')}</td>
                                            <td> ${inpBillDetail.amount}</td>
                                            <td> ${inpBillDetail.itemPrice}</td>
                                            <td> ${inpBillDetail.charges}</td>
                                            <td> ${inpBillDetail.costs}</td>
                                            <td> ${fns:getDeptName(inpBillDetail.orderDept,'')}</td>
                                            <td> ${fns:getUserName(inpBillDetail.orderDoctor)}</td>
                                            <td> ${fns:getDeptName(inpBillDetail.performDept,'')}</td>
                                            <td> ${fns:getUserName(inpBillDetail.performPerson)}</td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                                <div class="pagination">${page}</div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>
        <section class="main-content col-lg-4" style="display: none" id="RightDiv">
            <div class="content-wrap" id="rigthCenterDiv">
            </div>
        </section>
    </section>

</div>

